﻿Imports System.ComponentModel
Public Class IncomeClass
    Implements INotifyPropertyChanged

    Sub New()

    End Sub

    Public Event PropertyChanged( _
      ByVal sender As Object, _
      ByVal e As PropertyChangedEventArgs) _
      Implements INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub OnPropertyChanged(ByVal PropertyName As String)
        ' Raise the event, and make this procedure
        ' overridable, should someone want to inherit from
        ' this class and override this behavior:
        RaiseEvent PropertyChanged( _
          Me, New PropertyChangedEventArgs(PropertyName))
    End Sub

    Public Sub New(ByVal IncomeType As String, ByVal IncomeAmount As Decimal, ByVal IncomeDate As Date, ByVal IncomeId As Integer, ByVal IncomeTypeId As Integer, ByVal IncomeOneOff As Boolean, ByVal IncomeComment As String)
        ' Set the backing field so that
        ' you don't raise the PropertyChanged event
        ' when you first create the Customer.
        _IncomeType = IncomeType
        _IncomeAmount = IncomeAmount
        _IncomeDate = IncomeDate
        _IncomeId = IncomeId
        _IncomeTypeID = IncomeTypeId
        _IncomeOneOff = IncomeOneOff
        _IncomeComment = IncomeComment
    End Sub

    Private _IncomeType As String
    Private _IncomeAmount As Decimal
    Private _IncomeDate As Date
    Private _IncomeId As Integer
    Private _IncomeTypeID As Integer
    Private _IncomeOneOff As Boolean
    Private _IncomeComment As String
    Public Property IncomeType() As String
        Get
            Return _IncomeType
        End Get
        Set(ByVal value As String)
            If _IncomeType <> value Then
                _IncomeType = value
                OnPropertyChanged("IncomeType")
            End If
        End Set
    End Property

    Public Property IncomeAmount() As Decimal
        Get
            Return _IncomeAmount
        End Get
        Set(ByVal value As Decimal)
            If _IncomeAmount <> value Then
                _IncomeAmount = value
                OnPropertyChanged("IncomeAmount")
            End If
        End Set
    End Property

    Public Property IncomeDate() As Date
        Get
            Return _IncomeDate
        End Get
        Set(ByVal value As Date)
            If _IncomeDate <> value Then
                _IncomeDate = value
                OnPropertyChanged("IncomeDate")
            End If
        End Set
    End Property

    Public Property IncomeId() As Integer
        Get
            Return _IncomeId
        End Get
        Set(ByVal value As Integer)
            If _IncomeId <> value Then
                _IncomeId = value
                OnPropertyChanged("IncomeId")
            End If
        End Set
    End Property
    Public Property IncomeTypeId() As Integer
        Get
            Return _IncomeTypeID
        End Get
        Set(ByVal value As Integer)
            If _IncomeTypeID <> value Then
                _IncomeTypeID = value
                OnPropertyChanged("IncomeTypeId")
            End If
        End Set
    End Property

    Public Property IncomeOneOff() As Boolean
        Get
            Return _IncomeOneOff
        End Get
        Set(ByVal value As Boolean)
            If _IncomeOneOff <> value Then
                _IncomeOneOff = value
                OnPropertyChanged("IncomeOneOff")
            End If
        End Set
    End Property

    Public Property IncomeComment() As String
        Get
            Return _IncomeComment
        End Get
        Set(ByVal value As String)
            If _IncomeComment <> value Then
                _IncomeComment = value
                OnPropertyChanged("IncomeComment")
            End If
        End Set
    End Property
End Class
